package com.mission.schedule.activity;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Html;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ExpandableListView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.google.gson.Gson;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest.HttpMethod;
import com.mission.schedule.R;
import com.mission.schedule.applcation.App;
import com.mission.schedule.bean.NoteTypeBean;
import com.mission.schedule.bean.qd606.NoteTitleDetailBean;
import com.mission.schedule.constants.ShareFile;
import com.mission.schedule.constants.URLConstants;
import com.mission.schedule.utils.DateUtil;
import com.mission.schedule.utils.ProgressUtil;
import com.mission.schedule.utils.SharedPrefUtil;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.EmptyStackException;
import java.util.Iterator;
import java.util.List;

/**
 * Created by liwei on 2017/5/31.
 */

public class NoteOtherListActivity extends BaseActivity {

    LinearLayout top_ll_back;
    TextView title;

    int flag = 0;
    int style = 0;

    SharedPrefUtil sharedPrefUtil;
    List<NoteTypeBean.ListBean> listBeenType = new ArrayList<>();
    List<List<OtherBean.ListBean>> listList = new ArrayList<>();
    List<OtherBean.ListBean> db = new ArrayList<>();
    String admin = "0";
    String name = "";
    String puid = "";
    NoteExpandListAdapter expandListAdapter;
    ExpandableListView expandableListView;


    @Override
    protected void setListener() {
        top_ll_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void setContentView() {
        setContentView(R.layout.note_other_list);
    }

    @Override
    protected void init(Bundle savedInstanceState) {

        name = getIntent().getStringExtra("name");
        puid = getIntent().getStringExtra("puid");

        sharedPrefUtil = new SharedPrefUtil(this, ShareFile.USERFILE);
        userID = sharedPrefUtil.getString(this, ShareFile.USERFILE, ShareFile.USERID, "");
        admin = sharedPrefUtil.getString(this, ShareFile.USERFILE, ShareFile.ISADMIN, "0");
        top_ll_back = (LinearLayout) findViewById(R.id.top_ll_back);
        title = (TextView) findViewById(R.id.title);
        title.setText(name);

        expandableListView = (ExpandableListView) findViewById(R.id.expand_listview);
        expandableListView.addFooterView(LayoutInflater.from(this).inflate(R.layout.emptry_foolterview, null));
        expandableListView.setGroupIndicator(null);
        expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
            @Override
            public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
                return true;
            }
        });
        expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
            @Override
            public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {

                Intent intent = new Intent(NoteOtherListActivity.this, QDFXDetailActivity.class);
                intent.putExtra("type", 0);
                intent.putExtra("title", listList.get(groupPosition).get(childPosition).titles);
                intent.putExtra("titleId", listList.get(groupPosition).get(childPosition).titleId);
                intent.putExtra("path", listList.get(groupPosition).get(childPosition).imgPath);
                intent.putExtra("goodNum", "0");
                intent.putExtra("redNum", "1");
                intent.putExtra("name", name);
                intent.putExtra("time", listList.get(groupPosition).get(childPosition).createTime);
                intent.putExtra("num", listList.get(groupPosition).get(childPosition).nums);
                intent.putExtra("uid", puid);
                intent.putExtra("stylee", listList.get(groupPosition).get(childPosition).styles);
                startActivity(intent);

                return false;
            }
        });

        getData();
    }

    @Override
    protected void setAdapter() {
        expandListAdapter = new NoteExpandListAdapter(this, listBeenType, listList);
        expandableListView.setAdapter(expandListAdapter);
        for (int i = 0; i < listBeenType.size(); i++) {
            expandableListView.expandGroup(i);
        }
    }

    private Handler hander = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            switch (msg.what) {
                case 1:
                    setAdapter();
                    break;
            }
        }
    };

    private void send(int what) {
        Message message = new Message();
        message.what = what;
        hander.sendMessage(message);
    }


    String userID;
    ProgressUtil progressUtil = new ProgressUtil();

    private void getData() {
        listBeenType.clear();
        db.clear();
        progressUtil.ShowProgress(NoteOtherListActivity.this, true, true, "正在下载...");
        HttpUtils httpUtils = new HttpUtils(10000);
        RequestParams params = new RequestParams();
        params.addBodyParameter("uId", puid);
        httpUtils.send(HttpMethod.POST, URLConstants.清单分类下载, params, new RequestCallBack<String>() {
            @Override
            public void onSuccess(ResponseInfo<String> responseInfo) {
                if (!TextUtils.isEmpty(responseInfo.result)) {
                    Gson gson = new Gson();


                    NoteTypeBean bean = gson.fromJson(responseInfo.result, NoteTypeBean.class);
                    if (bean.status == 0) {
                        listBeenType = bean.list;
                        Collections.sort(listBeenType, new Comparator<NoteTypeBean.ListBean>() {
                            @Override
                            public int compare(NoteTypeBean.ListBean lhs, NoteTypeBean.ListBean rhs) {
                                return rhs.changeTime.compareTo(lhs.changeTime);
                            }
                        });
                        for (int i = 0; i < listBeenType.size() - 1; i++) {
                            for (int j = listBeenType.size() - 1; j > i; j--) {
                                if (listBeenType.get(j).localId == listBeenType.get(i).localId) {
                                    listBeenType.remove(j);
                                }
                            }
                        }

                        NoteTypeBean.ListBean blib = new NoteTypeBean.ListBean();
                        blib.localId = 0;
                        blib.orderId = 0;
                        blib.content = "";
                        blib.changeTime = DateUtil.formatDateTimeSs(new Date());
                        blib.remark = "";
                        blib.remark1 = "";
                        blib.styleId = 0;
                        blib.uid = Integer.valueOf(userID);
                        blib.id = 0;

                        listBeenType.add(blib);

                        Collections.sort(listBeenType, new Comparator<NoteTypeBean.ListBean>() {
                            @Override
                            public int compare(NoteTypeBean.ListBean lhs, NoteTypeBean.ListBean rhs) {
                                return lhs.orderId - rhs.orderId;
                            }
                        });
                    }else {
                        NoteTypeBean.ListBean blib = new NoteTypeBean.ListBean();
                        blib.localId = 0;
                        blib.orderId = 0;
                        blib.content = "";
                        blib.changeTime = DateUtil.formatDateTimeSs(new Date());
                        blib.remark = "";
                        blib.remark1 = "";
                        blib.styleId = 0;
                        blib.uid = Integer.valueOf(userID);
                        blib.id = 0;

                        listBeenType.add(blib);
                    }
                }else {
                    NoteTypeBean.ListBean blib = new NoteTypeBean.ListBean();
                    blib.localId = 0;
                    blib.orderId = 0;
                    blib.content = "";
                    blib.changeTime = DateUtil.formatDateTimeSs(new Date());
                    blib.remark = "";
                    blib.remark1 = "";
                    blib.styleId = 0;
                    blib.uid = Integer.valueOf(userID);
                    blib.id = 0;

                    listBeenType.add(blib);
                }
                HttpUtils httpUtils = new HttpUtils(10000);
                RequestParams params = new RequestParams();
                params.addBodyParameter("uId", puid);
                httpUtils.send(HttpMethod.POST, URLConstants.清单常见问题标题下载, params, new RequestCallBack<String>() {
                    @Override
                    public void onSuccess(ResponseInfo<String> responseInfo) {
                        if (!TextUtils.isEmpty(responseInfo.result)) {
                            Gson gson = new Gson();

                            OtherBean bean = gson.fromJson(responseInfo.result, OtherBean.class);
                            if (bean.status == 0) {
                                db = bean.list;

                                if (db.size() > 0) {
                                    for (NoteTypeBean.ListBean listBean : listBeenType) {
                                        List<OtherBean.ListBean> newdb = new ArrayList<OtherBean.ListBean>();
                                        for (OtherBean.ListBean tDelListBean : db) {
                                            if (tDelListBean.remark1.equals(listBean.localId + "") && tDelListBean.filed.equals("0")) {
                                                newdb.add(tDelListBean);
                                            }
                                        }
                                        Collections.sort(newdb, new Comparator<OtherBean.ListBean>() {
                                            @Override
                                            public int compare(OtherBean.ListBean lhs, OtherBean.ListBean rhs) {
                                                return rhs.changeTime.compareTo(lhs.changeTime);
                                            }
                                        });
                                        listList.add(newdb);

                                    }
                                    List<List<OtherBean.ListBean>> newdbs = new ArrayList<List<OtherBean.ListBean>>();
                                    List<NoteTypeBean.ListBean> listBeanList = new ArrayList<NoteTypeBean.ListBean>();
                                    for (int i = 0; i < listBeenType.size(); i++) {
                                        if (listList.get(i).size() != 0) {
                                            newdbs.add(listList.get(i));
                                            listBeanList.add(listBeenType.get(i));
                                        }
                                    }
                                    listList.clear();
                                    listBeenType.clear();

                                    listList.addAll(newdbs);
                                    listBeenType.addAll(listBeanList);
                                }else {
                                    Toast.makeText(NoteOtherListActivity.this, "无数据", Toast.LENGTH_SHORT).show();
                                }


                                send(1);
                            }
                        }
                    }

                    @Override
                    public void onFailure(HttpException e, String s) {
                        Toast.makeText(NoteOtherListActivity.this, "无数据", Toast.LENGTH_SHORT).show();
                    }
                });
                progressUtil.dismiss();
            }

            @Override
            public void onFailure(HttpException e, String s) {
                progressUtil.dismiss();
                Toast.makeText(NoteOtherListActivity.this, "网络异常", Toast.LENGTH_SHORT).show();
            }
        });

    }

    public static List removeEmptyList(List list) {
        List list1 = new ArrayList();

        if (list == null || list.size() <= 0)
            return null;
        //循环第一层
        for (int i = 0; i < list.size(); i++) {
            //进入每一个list
            List listi = (List) list.get(i);
            if (listi != null && listi.size() > 0)
                list1.add(listi);
            System.out.println(list1.size());
        }

        return list1;
    }


    class NoteExpandListAdapter extends BaseExpandableListAdapter {

        Context context;
        LayoutInflater layoutInflater;

        Handler handler;

        List<NoteTypeBean.ListBean> listList = new ArrayList<>();
        List<List<OtherBean.ListBean>> tdellist = new ArrayList<>();

        public NoteExpandListAdapter(Context context,
                                     List<NoteTypeBean.ListBean> listList,
                                     List<List<OtherBean.ListBean>> tdellist) {
            this.listList.clear();
            this.tdellist.clear();
            this.context = context;
            this.listList = listList;
            this.tdellist = tdellist;
            layoutInflater = LayoutInflater.from(context);
        }

        @Override
        public int getGroupCount() {
            return listList.size();
        }

        @Override
        public int getChildrenCount(int groupPosition) {
            return listList.size() == 0 ? 0 : tdellist.get(groupPosition).size();
        }

        @Override
        public Object getGroup(int groupPosition) {
            return null;
        }

        @Override
        public Object getChild(int groupPosition, int childPosition) {
            return null;
        }

        @Override
        public long getGroupId(int groupPosition) {
            return 0;
        }

        @Override
        public long getChildId(int groupPosition, int childPosition) {
            return 0;
        }

        @Override
        public boolean hasStableIds() {
            return false;
        }


        @Override
        public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
            final GroupViewHolder viewHolder;
            if (convertView == null) {
                viewHolder = new GroupViewHolder();
                convertView = layoutInflater.inflate(R.layout.note_other_group_item, parent, false);
                viewHolder.name = (TextView) convertView.findViewById(R.id.name);
                viewHolder.ll = (LinearLayout) convertView.findViewById(R.id.ll);
                convertView.setTag(viewHolder);
            } else {
                viewHolder = (GroupViewHolder) convertView.getTag();
            }
            viewHolder.name.setText(listList.get(groupPosition).content);
            if (listList.get(groupPosition).content.isEmpty()) {
                viewHolder.ll.setVisibility(View.GONE);
            } else {
                viewHolder.ll.setVisibility(View.VISIBLE);
            }

            return convertView;
        }


        class GroupViewHolder {
            TextView name;
            LinearLayout ll;
        }

        @Override
        public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
            final ChildViewHolder viewHolder;
            if (convertView == null) {
                viewHolder = new ChildViewHolder();
                convertView = layoutInflater.inflate(R.layout.adapter_qdotherlist, parent, false);
                viewHolder.qdll = (LinearLayout) convertView.findViewById(R.id.qdll);
                viewHolder.time = (TextView) convertView.findViewById(R.id.time);
                viewHolder.title = (TextView) convertView.findViewById(R.id.title);
                viewHolder.share = (TextView) convertView.findViewById(R.id.share);
                convertView.setTag(viewHolder);
            } else {
                viewHolder = (ChildViewHolder) convertView.getTag();
            }

//            viewHolder.qdll.setOnClickListener(new View.OnClickListener() {
//                @Override
//                public void onClick(View v) {
//                }
//            });


            if (tdellist.get(groupPosition).size() > 0) {
                if (tdellist.get(groupPosition).get(childPosition).titleId != null) {
                    String shares = "";
                    if (tdellist.get(groupPosition).get(childPosition).nums.equals("0") || tdellist.get(groupPosition).get(childPosition).nums.isEmpty()) {
                        if (tdellist.get(groupPosition).get(childPosition).openState == 0) {
                            shares = "公开";
                        }
                    } else {
                        shares = "已分享";
                        if (tdellist.get(groupPosition).get(childPosition).openState == 1) {
                            shares = "公开 已分享";
                        }
                    }
//                    viewHolder.share.setText(shares);
                    int num = App.getDBcApplication().getTitleNoteDetailData(tdellist.get(groupPosition).get(childPosition).uid + "", tdellist.get(groupPosition).get(childPosition).titleId, false).size();
                    String titlestr;
                    if (tdellist.get(groupPosition).get(childPosition).titles.equals("")) {
                        titlestr = App.getDBcApplication().getNoteTitleDetailContent(tdellist.get(groupPosition).get(childPosition).uid + "", tdellist.get(groupPosition).get(childPosition).titleId);
                        if (titlestr.isEmpty()) {
                            titlestr = "无标题";
                        } else {
                            if (titlestr.length() > 12) {
                                titlestr = titlestr.substring(0, 12);
                            }
                        }

                    } else {
                        titlestr = tdellist.get(groupPosition).get(childPosition).titles;
                    }

                    String nums;
                    if (num == 0) {
                        if (tdellist.get(groupPosition).get(childPosition).titleId.equals("0")) {
                            titlestr = "<font color='#000000'>" + titlestr + "</>";//30a9a0
                        } else {
                            titlestr = "<font color='#000000'>" + titlestr + "</>";
                        }
                        viewHolder.title.setText(Html.fromHtml(titlestr));
                    } else {
                        if (tdellist.get(groupPosition).get(childPosition).styles == 0) {
                            int tick = App.getDBcApplication().getNoteDetailEndstateNums(tdellist.get(groupPosition).get(childPosition).titleId, tdellist.get(groupPosition).get(childPosition).uid + "");
                            if (num == 0) {
                                nums = "";
                            } else {
                                nums = "<font color='#aaaaaa'>(" + tick + "/" + num + ")</>";
                            }

                            if (tdellist.get(groupPosition).get(childPosition).titleId.equals("0")) {
                                titlestr = "<font color='#000000'>" + titlestr + "</>";
                                viewHolder.title.setText(Html.fromHtml(titlestr + nums));
                            } else {
                                if (num == 0) {
                                    setcolor(titlestr, viewHolder.title);
                                } else {
                                    setcolor(titlestr + "(" + tick + "/" + num + ")", viewHolder.title);
                                }
                            }
                        } else {
                            if (num == 0) {
                                nums = "<font color='#aaaaaa'>(" + num + ")</>";
                            } else {
                                nums = "";
                            }
                            if (tdellist.get(groupPosition).get(childPosition).titleId.equals("0")) {
                                titlestr = "<font color='#000000'>" + titlestr + "</>";
                                viewHolder.title.setText(Html.fromHtml(titlestr + nums));
                            } else {
                                if (num == 0) {
                                    setcolor(titlestr, viewHolder.title);
                                } else {
                                    setcolor(titlestr + "(" + num + ")", viewHolder.title);
                                }
                            }
                        }
                    }
                    if (tdellist.get(groupPosition).get(childPosition).createTime != null) {
                        //+(tdellist.get(groupPosition).get(childPosition).pname.isEmpty() ?  "" : " @"+tdellist.get(groupPosition).get(childPosition).pname)
                        viewHolder.time.setText(tdellist.get(groupPosition).get(childPosition).createTime.substring(5, tdellist.get(groupPosition).get(childPosition).createTime.length() - 3).replace('T', ' '));
                    }
                }
            }
            return convertView;
        }


        class ChildViewHolder {
            LinearLayout qdll;
            TextView title, time, share;
        }


        @Override
        public boolean isChildSelectable(int groupPosition, int childPosition) {
            return true;
        }


        //设置双#号包裹的文字颜色
        private void setcolor(String content, TextView editText) {
            SpannableStringBuilder builder = new SpannableStringBuilder(content);
            if (content.length() > 1) {
                List<Integer> integerList = new ArrayList<>();
                int index = 0;
                int count = hit(content, "#");
                if (count > 1) {
                    if (count % 2 == 0) {
                        for (int i = 0; i < count; i++) {
                            if (i == 0) {
                                index = content.indexOf("#");
                            } else {
                                index = content.indexOf("#", index + 1);
                            }
                            integerList.add(index);
                        }
                        for (int i = 0; i < integerList.size(); i++) {
                            if (i > 0) {
                                if (i % 2 != 0) {
                                    ForegroundColorSpan span = new ForegroundColorSpan(Color.BLACK);
                                    builder.setSpan(span, integerList.get(i - 1), integerList.get(i) + 1, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
                                }
                            }
                        }
                        ForegroundColorSpan span = new ForegroundColorSpan(Color.parseColor("#aaaaaa"));
                        int khindex = content.indexOf("(");
                        builder.setSpan(span, khindex, content.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                        editText.setText(builder);
                    } else {
                        for (int i = 0; i < count - 1; i++) {
                            if (i == 0) {
                                index = content.indexOf("#");
                            } else {
                                index = content.indexOf("#", index + 1);
                            }
                            integerList.add(index);

                        }
                        for (int i = 0; i < integerList.size(); i++) {
                            if (i > 0) {
                                if (i % 2 != 0) {
                                    ForegroundColorSpan span = new ForegroundColorSpan(Color.RED);
                                    builder.setSpan(span, integerList.get(i - 1), integerList.get(i) + 1, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
                                }
                            }
                        }
                        ForegroundColorSpan span = new ForegroundColorSpan(Color.parseColor("#aaaaaa"));
                        int khindex = content.indexOf("(");
                        builder.setSpan(span, khindex, content.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                        editText.setText(builder);
                    }
                } else {
                    ForegroundColorSpan span = new ForegroundColorSpan(Color.parseColor("#aaaaaa"));
                    int khindex = content.indexOf("(");
                    builder.setSpan(span, khindex, content.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                    editText.setText(builder);
                }
            } else {
                ForegroundColorSpan span = new ForegroundColorSpan(Color.parseColor("#aaaaaa"));
                int khindex = content.indexOf("(");
                builder.setSpan(span, khindex, content.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                editText.setText(builder);
            }
        }

        public int hit(String a, String b) {
            if (a.length() < b.length()) {
                return 0;
            }
            char[] a_t = a.toCharArray();
            int count = 0;

            for (int i = 0; i < a.length(); i++) {
                StringBuffer buffer = new StringBuffer();
                for (int j = 0; j < b.length(); j++) {
                    buffer.append(a_t[i + j]);
                }
                if (buffer.toString().equals(b)) {
                    count++;
                }
            }

            return count;
        }
    }


    class OtherBean {


        /**
         * status : 0
         * downTime : 2017-06-15T14:53:06
         * message : 成功
         * list : [{"orderId":0,"puid":0,"states":0,"filed":"1","openState":1,"pname":"","remark1":"0","remark2":"0","styles":3,"shareUrl":"","localTimes":"2017-06-01 11:59:15","remark3":"0","id":39752,"remark4":"0","uid":260975,"nums":"20170601115925056986","imgUrl":"","titles":"夏季9种养生方法","titleId":"20170601115805663531","sends":0,"changeTime":"2017-06-09T12:00:45","createTime":"2017-06-09T12:00:45","remark":"0","copys":"1","imgPath":"","ltype":1}]
         * tDelList : null
         * delList : null
         */

        private int status;
        private String downTime;
        private String message;
        private Object tDelList;
        private Object delList;
        private List<ListBean> list;

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public String getDownTime() {
            return downTime;
        }

        public void setDownTime(String downTime) {
            this.downTime = downTime;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public Object getTDelList() {
            return tDelList;
        }

        public void setTDelList(Object tDelList) {
            this.tDelList = tDelList;
        }

        public Object getDelList() {
            return delList;
        }

        public void setDelList(Object delList) {
            this.delList = delList;
        }

        public List<ListBean> getList() {
            return list;
        }

        public void setList(List<ListBean> list) {
            this.list = list;
        }

        public class ListBean {
            /**
             * orderId : 0
             * puid : 0
             * states : 0
             * filed : 1
             * openState : 1
             * pname :
             * remark1 : 0
             * remark2 : 0
             * styles : 3
             * shareUrl :
             * localTimes : 2017-06-01 11:59:15
             * remark3 : 0
             * id : 39752
             * remark4 : 0
             * uid : 260975
             * nums : 20170601115925056986
             * imgUrl :
             * titles : 夏季9种养生方法
             * titleId : 20170601115805663531
             * sends : 0
             * changeTime : 2017-06-09T12:00:45
             * createTime : 2017-06-09T12:00:45
             * remark : 0
             * copys : 1
             * imgPath :
             * ltype : 1
             */

            private int orderId;
            private int puid;
            private int states;
            private String filed;
            private int openState;
            private String pname;
            private String remark1;
            private String remark2;
            private int styles;
            private String shareUrl;
            private String localTimes;
            private String remark3;
            private int id;
            private String remark4;
            private int uid;
            private String nums;
            private String imgUrl;
            private String titles;
            private String titleId;
            private int sends;
            private String changeTime;
            private String createTime;
            private String remark;
            private String copys;
            private String imgPath;
            private int ltype;

            public int getOrderId() {
                return orderId;
            }

            public void setOrderId(int orderId) {
                this.orderId = orderId;
            }

            public int getPuid() {
                return puid;
            }

            public void setPuid(int puid) {
                this.puid = puid;
            }

            public int getStates() {
                return states;
            }

            public void setStates(int states) {
                this.states = states;
            }

            public String getFiled() {
                return filed;
            }

            public void setFiled(String filed) {
                this.filed = filed;
            }

            public int getOpenState() {
                return openState;
            }

            public void setOpenState(int openState) {
                this.openState = openState;
            }

            public String getPname() {
                return pname;
            }

            public void setPname(String pname) {
                this.pname = pname;
            }

            public String getRemark1() {
                return remark1;
            }

            public void setRemark1(String remark1) {
                this.remark1 = remark1;
            }

            public String getRemark2() {
                return remark2;
            }

            public void setRemark2(String remark2) {
                this.remark2 = remark2;
            }

            public int getStyles() {
                return styles;
            }

            public void setStyles(int styles) {
                this.styles = styles;
            }

            public String getShareUrl() {
                return shareUrl;
            }

            public void setShareUrl(String shareUrl) {
                this.shareUrl = shareUrl;
            }

            public String getLocalTimes() {
                return localTimes;
            }

            public void setLocalTimes(String localTimes) {
                this.localTimes = localTimes;
            }

            public String getRemark3() {
                return remark3;
            }

            public void setRemark3(String remark3) {
                this.remark3 = remark3;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getRemark4() {
                return remark4;
            }

            public void setRemark4(String remark4) {
                this.remark4 = remark4;
            }

            public int getUid() {
                return uid;
            }

            public void setUid(int uid) {
                this.uid = uid;
            }

            public String getNums() {
                return nums;
            }

            public void setNums(String nums) {
                this.nums = nums;
            }

            public String getImgUrl() {
                return imgUrl;
            }

            public void setImgUrl(String imgUrl) {
                this.imgUrl = imgUrl;
            }

            public String getTitles() {
                return titles;
            }

            public void setTitles(String titles) {
                this.titles = titles;
            }

            public String getTitleId() {
                return titleId;
            }

            public void setTitleId(String titleId) {
                this.titleId = titleId;
            }

            public int getSends() {
                return sends;
            }

            public void setSends(int sends) {
                this.sends = sends;
            }

            public String getChangeTime() {
                return changeTime;
            }

            public void setChangeTime(String changeTime) {
                this.changeTime = changeTime;
            }

            public String getCreateTime() {
                return createTime;
            }

            public void setCreateTime(String createTime) {
                this.createTime = createTime;
            }

            public String getRemark() {
                return remark;
            }

            public void setRemark(String remark) {
                this.remark = remark;
            }

            public String getCopys() {
                return copys;
            }

            public void setCopys(String copys) {
                this.copys = copys;
            }

            public String getImgPath() {
                return imgPath;
            }

            public void setImgPath(String imgPath) {
                this.imgPath = imgPath;
            }

            public int getLtype() {
                return ltype;
            }

            public void setLtype(int ltype) {
                this.ltype = ltype;
            }
        }
    }


}
